# -*- coding:utf-8 -*-
# __author__ : "张百科"
# Date: 2021/1/26 10:18
# File: notice.py
# IDE: PyCharm
from rest_framework import serializers
from models.notice import Notice


class NoticeSerializer(serializers.ModelSerializer):
    title = serializers.CharField(label='标题', max_length=50, help_text='标题',required=True)
    content=serializers.CharField(label='内容', max_length=5000,  help_text='内容',required=True)
    is_top=serializers.IntegerField(read_only=True)
    read_count = serializers.IntegerField(read_only=True)

    class Meta:
        model = Notice
        exclude = ('is_delete',)